package com.todo.user.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/4/7 20:43
 * @description
 */
@Getter
@AllArgsConstructor
public enum TravelPlanTypeEnum {

    BUDGET_TOUR(1, "BUDGET_TOUR", "穷游看世界"),
    WEEKEND_LEISURE(2, "WEEKEND_LEISURE", "周末休闲"),
    SPECIAL_TRAVEL(3, "SPECIAL_TRAVEL", "特种兵出征"),
    EXPLORE_THE_WORLD(4, "EXPLORE_THE_WORLD", "探索世界"),
    ENJOY_LIFE(5, "ENJOY_LIFE", "享受当下"),
    TRAVEL_PAIRING(6, "TRAVEL_PAIRING", "旅游搭子"),
    EXTREME_CHALLENGE(7, "EXTREME_CHALLENGE", "极限挑战"),
    ;

    private static Map<Integer, TravelPlanTypeEnum> typeMap = Arrays
            .stream(TravelPlanTypeEnum.values())
            .collect(Collectors.toMap(TravelPlanTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static TravelPlanTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
